import jobService from "#/service/job";
import jobLogService from "#/service/job/log";
import { createBaseController } from "#/utils";
import type { Application } from "express";
export default function (app: Application) {
  createBaseController(app, "/wscc/job", jobService);

  app.get("/wscc/job/manage/list", async (req, res) => {
    res.send(await jobService.queryList(req.query as any));
  });
  app.get("/wscc/job/log", async (req, res) => {
    res.send(await jobLogService.queryList(req.query as any));
  });
  app.get("/wscc/job/count", async (req, res) => {
    res.send(await jobService.queryCount());
  });
  app.put("/wscc/job/status", async (req, res) => {
    res.send(await jobService.updateStatus(req.body));
  });
}
